package com.whjfxx.terminal.commons;

import com.alibaba.fastjson.JSONObject;
import com.whjfxx.terminal.exceptions.BizException;
import com.whjfxx.terminal.utils.MD5Util;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;

public class ApiDecodeUtil {

    private final static Logger logger = LoggerFactory.getLogger(ApiDecodeUtil.class);
    
    public static <T> T encodeTeBean(String data, Class<T> clazz) {
        String paramJsonStr = Base64Util.decodeToString(data);
        // json转换成对象
        T obj = JSONObject.parseObject(paramJsonStr, clazz);
        return obj;
    }

}
